using (SPSite spsite = new SPSite("http://SPS01")) { using (SPWeb spweb = spsite.OpenWeb()) { spweb.AllowUnsafeUpdates = true; SPFolder spfolder = spweb.Folders[Site + "/Shared Documents/"]; //spfolder.Files["Sample.docx"].Delete(); //Recycle file from parent folder. //spfolder.Files["Sample.docx"].Recycle(); //Delete file from subfolder. //spfolder.SubFolders["Demonstration Folder"].Files["Sample1.docx"].Delete(); spfolder.Update(); } }